package top.purity.framework.orm.jpa;

import org.springframework.data.domain.AuditorAware;
import top.purity.framework.common.UserContextHolder;

import java.util.Optional;

/**
 * @version 1.0
 * @Author Lmh
 * @Description
 * @CreateTime 2023-10-29 14:38
 */

public class AuditorConfig implements AuditorAware<Long> {
    @Override
    public Optional<Long> getCurrentAuditor() {
        return Optional.of(UserContextHolder.getUserId());
    }
}
